package com.fantuan.db.dao;

import java.sql.Connection;
import java.sql.SQLException;

import org.apache.commons.dbutils.DbUtils;
import org.apache.commons.dbutils.handlers.BeanHandler;
import org.springframework.stereotype.Service;

import com.fantuan.db.bean.FundLog;
import com.fantuan.db.bean.GroupType;

@Service
public class GroupTypeDAO extends BaseDAO{

	public GroupType getGroupType(int nid) throws SQLException {

		Connection conn = dataSource.getConnection();

		String sql = "select * from t_grouptypemaster where nid=?";

		GroupType result = null;
		try {

			Object[] objs = new Object[] { nid };

			result = (GroupType) this.query(conn, sql, new BeanHandler<GroupType>(
					GroupType.class), objs);

		} catch (SQLException e) {
			e.printStackTrace();
		} finally {
			DbUtils.close(conn);
		}

		return result;
	}

}
